1. Field of the Invention
This invention relates to graphics processors. In particular, the invention relates to hardware clipping for bit-packed fonts.
2. Description of Related Art
Advances in graphics processor design have allowed many complex graphic operations to be performed at very high speed. In modern graphic processors, special hardware circuits have been designed to perform primitive operations. Examples of these operations include block transfers (BLT), color expansion, block fill, line drawing, area drawing, and transparency operations. To invoke these operations, a graphic driver usually has to configure the graphic processor with appropriate control parameters.
One useful application of graphics is the manipulation of textual fonts, or bit mapped objects. Among the operations that manipulate fonts, clipping is an important step to generate a primitive graphical object for further processing. A clipping operation extracts a rectangular region in the font object. To prepare for the clipping operation to be performed by the graphics processor, a graphic driver provides the desired clipping parameters to the hardware. These clipping parameters include the number of pixels to be clipped in all four directions: top, bottom, left, and right. The ranges of these parameters are usually limited due to the limited size of the control registers that hold the parameters. When the desired clipping parameters exceed these ranges, it is necessary to perform additional pre-clip operations before configuring the hardware clipping circuitry in the graphics processor. Since these pre-clip operations are not part of the hardware and are performed by the software in the graphic driver, they tend to be slow and inefficient. When the fonts or glyphs are represented by a bit packing scheme, the problem is even more complicated.
Therefore, there is a need in the technology to provide a simple and efficient method to enhance the hardware clipping ability for bit-packed fonts.
In one embodiment, the present invention relates to a method for enhancing clipping a bit-packed glyph. The method comprises determining if a first clip value is less than a first maximum value. If the first clip value exceeds the first maximum value, a second clip value and a third clip value are updated by a difference between the first clip value and the first maximum value, and the first clip value is replaced by the maximum value. Then, an address field value is updated by a predetermined address amount.